package day05;

public class MethodDemo1 {
	public static void main(String[] args) {
		say();
		sayHi("牛马");
		sayHi("牛驴 ");
		sayHello("张三",34);
		sayHello("lisi",23);
	}
	
	
	public static void sayHello(String name,int age){
		if (age>=60){
			return;
		}
		
		System.out.println("大家好我叫"+name+"今年"+age+"岁了");
	}
	public static void sayHi(String name){
		System.out.println("大家好我叫"+name+"今年34岁了");
	}
	public static void say(){
		System.out.println("大家好大家好");
	}
	public static void say(int age){} //正确的重载
	public static void say(int age,String name){} //正确的重载
	//public static int say(){ return 1; } //编译错误，重载与返回值类型无关
	//public static void say(String address){} //编译错误，重载与参数名称无关
	
	public static void a(){
		System.out.println(111);
		b(); //嵌套调用
		System.out.println(222);
	}
	public static void b(){
		System.out.println(333);
	}
	
}

